﻿using System;
using System.Collections.Generic;

namespace DMS.BO.Models
{
    public class SearchResult
    {
        protected SearchResult(ISearchFilter filter)
        {
            Filter = filter;
        }

        public int TotalRecords { get; set; }

        public ISearchFilter Filter { get; private set; }

        public int TotalPages
        {
            get
            {
                if (Filter.PageSize == 0)
                    return 0;
                return (int)Math.Ceiling(((decimal)TotalRecords / Filter.PageSize));
            }
        }


    }
   
    public class SearchResult<TResult> : SearchResult
    {
        public List<TResult> List;

        public SearchResult(ISearchFilter filter)
            : base(filter)
        {
        }
    }


}